<template>
  <div>
    <ul class="left-cont">
      <li class="f-list"
          v-for="(item,index) in list"
          :key="index" @click="addPatient(index, item.count)">
        <div class="orderNumber">{{item.count}}</div>
        <div class="perinfo">
          <div class="p-name">
            <span>{{item.name}}</span>
            <span>{{item.gender}}</span>
          </div>
          <p class="p-num">{{item.num}}</p>
        </div>
      </li>
    </ul>
  </div>
</template>

<script>
export default {
  data () {
    return {
      bed: []
    }
  },
  components: {},
  props: ['list'],
  methods: {
    addPatient (ind, bed) {
      if (this.bed.indexOf(bed) === -1) {
        this.bed.push(bed)
        this.$emit('childBed', this.bed, ind)
      }
    }
  }
}
</script>

<style lang="stylus" scoped>
.left-cont {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;

  .f-list {
    width: 2.66rem;
    height: 0.99rem;
    background-color: #fff;
    border-radius: 0.15rem;
    box-shadow: 0 0 0.1rem #e9edf2;
    display: flex;
    margin-bottom: 0.3rem;
    margin-right: 0.22rem;

    .orderNumber {
      width: 0.54rem;
      background-color: #29b8ff;
      border-top-left-radius: 0.15rem;
      border-bottom-left-radius: 0.15rem;
      text-align: center;
      line-height: 0.99rem;
      font-size: 0.24rem;
      color: #fff;
    }

    .perinfo {
      padding: 0.2rem 0 0 0.2rem;

      span {
        &:nth-of-type(1) {
          font-size: 0.32rem;
        }

        &:nth-of-type(2) {
          font-size: 0.2rem;
          color: #7f889a;
        }
      }

      .p-name {
        margin-bottom: 0.13rem;
      }

      .p-num {
        font-size: 0.2rem;
        color: #7f889a;
      }
    }
  }
}
</style>
